<?php
/**
 * La classe soap frontale de l'API
 * 
 * @package zfbook
 * @subpackage reservation
 */
class Zfbook_Reservation_RssServer
extends Zfbook_Reservation_Server
implements Zfbook_Feed_Interface
{

    public function getRssArray()
    {
        $rss = array(
        'title'   => 'Reservations',
        'link'    => 'http://html.zfbook/webservice/rss',
        'charset' => 'utf-8'
        );
        $reservations = $this->getReservations(
        '2008-08-01 00:00:00', '2100-01-01 00:00:00'
        );
        foreach ($reservations as $reservation)
        {
            $entry = array();
            $entry['title'] = $reservation['usage'];
            $entry['link'] = 'http://html.zfbook/reservation/edit/r/' . $reservation['id'];
            $entry['description'] = 'Room ' . $reservation['id_room'] . ' from '
            . $reservation['date_begin'] . ' to '
            . $reservation['date_end'];
            $rss['entries'][] = $entry;
        }
        return $rss;
    }
}
